const path = require('path');
const AutoImport = require('unplugin-auto-import/webpack').default;

if (process.env.UNI_PLATFORM === 'h5') {
  process.env.UNI_OUTPUT_DIR = path.join(__dirname, 'build');
}

module.exports = {
  devServer: {
    // 代理配置
    // proxy: {
    //   '/api': {
    //     target: 'https://www.api.com',
    //     changeOrigin: true,
    //   },
    // },
  },

  transpileDependencies: ['uview-ui'],

  configureWebpack: {
    plugins: [
      AutoImport({
        imports: [
          {
            'rexma-cli': ['xma'],
          },
        ],
      }),
    ],
  },
};
